export interface InterfaceStudy1 {
  name?: string
  readonly age: number

  test(): void

}

export interface InterfaceStudy2 extends InterfaceStudy1 {

  sex: number

}


export function testInterface() {
  let testObj: InterfaceStudy2 = {
    name: '',
    sex: 0,
    age: 0,
    test: (): void => {
      throw new Error('Function not implemented.')
    }
  }
}

type testType = { num: number }

// 接口继承自定义类型
interface TestInterfaceExtType extends testType {
  num1: number
}

let testInterfaceExtTypeObj: TestInterfaceExtType = {
  num1: 0,
  num: 0
}

// 自定义类型扩展接口
type testType1 = { num3: number } & TestInterfaceExtType

let testType1Obj: testType1 = {
  num1: 0,
  num: 0,
  num3: 0
}
